package com.mall.untils;

/**
 * Created by konglinghui on 15/5/15.
 */
public class CommonUtil {

    public static void main(String[] args){
        System.out.println(CommonUtil.numberWithDelimiter(8888888));
    }

    public static String createClassCode(int kindergartenId, int grade, int classNum, int type) {

        //ideal_token的结构：  dads
        //xxxxx  x    x    xx
        //园id  身份 级部  班级
        String classNumStr;
        if (classNum < 10) {
            classNumStr = "0" + classNum;
        } else {
            classNumStr = classNum + "";
        }
        return "" + kindergartenId + type + grade + classNumStr;
    }

    /**
     * 数字转成有，的数字(33,333,333)
     */
    public static String numberWithDelimiter(long num) {
        StringBuilder accum = new StringBuilder();
        accum.append(num);
        return accum.toString();
    }
}
